/**
 * 替换文本内容: 如果超出指定长度则将超出部分替换为占位符, 没有则原样返回
 * @param content
 * @param subLength
 * @param placeholder
 */
export const subContent = (content: string, subLength: number = 5, placeholder: string = '...') => {
  if (!content) return content;
  let length = content.length;
  if (length > subLength) {
    return content.substring(0, subLength) + placeholder;
  } else {
    return content;
  }
}
